﻿namespace ML.Entity
{
    /// <summary>
    /// 封装查询条件(提供给存储过程查询分页使用)
    /// </summary>
    public class PageCriteria
    {
        /// <summary>
        /// 默认构造函数
        /// </summary>
        public PageCriteria()
        {
            Field = "*";
            PageSize = 1;
            PageIndex = 10;
            SortName = "";
            Sort = "ASC";
            Conditions = "WHERE 1=1";
        }

        /// <summary>
        /// 表名称
        /// </summary>
        public string TableName { get; set; }

        /// <summary>
        /// 字段
        /// </summary>
        public string Field { get; set; }

        /// <summary>
        /// 查询条件
        /// </summary>
        public string Conditions { get; set; }

        /// <summary>
        /// 排序字段
        /// </summary>
        public string SortName { get; set; }

        /// <summary>
        /// 排序方式
        /// </summary>
        public string Sort { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 一页显示的条数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 总条数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 返回的总页数
        /// </summary>
        public int PageCount { get; set; }
    }
}